package com.qd.common.panda.domain.entity.stroke.preferential;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.cdqidi.valid.group.DefaultGroup;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 优惠记录,APP查看
 *
 * @author sjk
 */
@Getter
@Setter
@ToString
public class AppUserStrokeOrderPreferentialLogDisplayDTO {
    /**
     * 订单ID
     */
    private String orderId;
    /**
     * 金额
     */
    @ExcelIgnore
    private BigDecimal price;
    /**
     * 金额显示
     */
    private String priceDisplay;
    /**
     * 折扣
     */
    private Double customerDiscount;
    /**
     * 优惠金额:这一单优惠了多少钱
     */
    private BigDecimal discountAmount;
    /**
     * 优惠金额显示
     */
    private String discountAmountDisplay;
    /**
     * 服务费
     */
    private BigDecimal serviceCharge;
    /**
     * 服务费显示
     */
    private String serviceChargeDisplay;
    /**
     * 优惠种类
     */
    @NotBlank(message = "优惠种类不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "优惠种类长度不能超过{max}位", groups = DefaultGroup.class)
    private String preferentialCategory;
    /**
     * 优惠种类显示
     */
    private String preferentialCategoryDisplay;
    /**
     * 开始时间
     */
    private LocalDateTime addTime;
    /**
     * 行程类型:0停车1充电2加油
     */
    @ExcelIgnore
    private Integer tripType;
    /**
     * 行程类型显示
     */
    private String tripTypeDisplay;
    /**
     * 停车场名称
     */
    private String parkName;
    /**
     * 扩展信息
     */
    private ObjectNode extendInfo;


    public void freeData() {
        this.price = null;
        this.priceDisplay = null;
        this.customerDiscount = null;
        this.discountAmount = null;
        this.discountAmountDisplay = null;
        this.preferentialCategory = null;
        this.preferentialCategoryDisplay = null;
        this.orderId = null;
        this.tripType = null;
        this.tripTypeDisplay = null;
        this.serviceCharge = null;
        this.serviceChargeDisplay = null;
        this.extendInfo = null;
        this.addTime = null;
    }
}
